<?php

$query = "SELECT COUNT(*) AS messages FROM messages where receiverID = '" . $_SESSION['ls_userid'] . "' AND readStatus = 'UNREAD'";
$result = mysql_query($query) or die("Could not get message count." . mysql_error());
$row = mysql_fetch_array($result);

if(isset($_SESSION['ls_userid'])) {
	echo '
	<li class="cat-item">Welcome, ' . $_SESSION['ls_name'] . '!</li>' .
	'<li class="cat-item"><a href=\'http://www.hungmun.com/c410/site-gui/logout.php\'>Logout</a></li>
	<li class="cat-item"><a href = "http://www.hungmun.com/c410/site-gui/members/messaging/inbox.php">You have '.$row['messages'].' unread messages!</a></li> '
	;
	
}

else {
	echo '
	<li class="cat-item"><a href="http://www.hungmun.com/c410/site-gui/user_login/login.php">User Login</a></li>
	<li class="cat-item"><a href="http://www.hungmun.com/c410/site-gui/user_login/register.php">Register</a></li>
	';
}


?>
